package day34;

import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) {
            int n = in.nextInt();
            String[] str = new String[n];
            while (in.hasNextLine()) { // 注意 while 处理多个 case
                for (int i = 0; i < n; i++) {
                    str[i] = in.nextLine();
                }
                StringBuilder str1 = new StringBuilder();
                for (int i = 0; i < n; i++) {
                    if (str[i].indexOf(',') != -1 && str[i].indexOf(" ") != -1) {
                        str1.append(str[i]);
                        if (i != n - 1) {
                            str1.append(',');
                        }
                    } else {
                        str1.append("\"");
                        str1.append(str[i]);
                        str1.append("\"");
                        if (i != n - 1) {
                            str1.append(',');
                        }
                    }
                }
                System.out.println(str1.toString());
            }
        }
    }




    public static void main(String[] args) {
        Math.pow(2,3);
    }
}